﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.CodeRush.StructuralParser;

namespace DX_SourceOutliner
{

    public class VisibilityByAccessibilityProcessor : VisibilityProcessorBase
    {

        /// <summary>
        /// Initializes a new instance of the VisibilityByAccessibilityProcessor class.
        /// </summary>
        /// <param name="options"></param>
        public VisibilityByAccessibilityProcessor(NodeOptions options)
            : base(options)
        {

        }

        protected override bool CheckNodeVisibility()
        {
            IMemberElement member = _source.Element as IMemberElement;

            if (member == null) return true;

            switch (member.Visibility)
            {
                case MemberVisibility.Public:
                    return _options.ShowPublicMembers;

                case MemberVisibility.Protected:
                    return _options.ShowProtectedMembers;

                case MemberVisibility.Private:
                    return _options.ShowPrivateMembers;

                case MemberVisibility.Internal:
                    return _options.ShowInternalMembers;

                case MemberVisibility.ProtectedInternal:
                    return _options.ShowProtectedInternalMembers;

                default:
                    return false;

            }


        }
        

    }
}
